1. Field of the Invention
The present invention relates to a pixel processing method, and more particularly, to a pixel processing method and image processing system for reconstructing missing color components of each pixel.
2. Description of the Prior Art
In a conventional image processing system, when an image is sensed by an image sensor, the image sensor will transmit the color component value of each pixel to a line buffer of an image signal processor (ISP), and save it in the line buffer temporarily, wherein each pixel comprises a color component value of a single color, as shown in FIG. 1. FIG. 1 is a diagram illustrating a color filter array 10 generated by an image sensor of a conventional image processing system which senses an ambient image. Each row of the color filter array 10 is composed by arranging different color component values of each pixel alternatively. Taking FIG. 1 as an example, the first row of the color filter array 10 saves the color component values of each pixel via arranging the red and the green colors (i.e., RG) alternatively, and then the second row saves the color component values of each pixel via arranging the green and the blue colors (i.e., GB) alternatively, and so on. However, each pixel is required to have the red, green and blue (i.e., RGB) color component values when a display displays an image; therefore, the color component value of each pixel in the color filter array 10 has to be processed for deriving the red, green and blue color component values of each pixel before being transmitted to a display driver of the display. Then, the display driver drives the display to show the image according to the red, green and blue color component values of each pixel.
Please refer to FIG. 1 again. If it is desired to compute the green color value G33 of the pixel 33 (i.e., the pixel with the red color value R33 shown in FIG. 1), the prior art design generates a horizontal difference dh and a vertical difference dv of the pixel 33 first, then compares the horizontal difference dh and the vertical difference dv for determining the color distribution of the pixel 33, and then selects an interpolation method used to interpolate the desired green color value G33 according to the color distribution. Furthermore, the prior art design deduces the horizontal difference dh and the vertical difference dv by the color difference magnitude of the same color, that is, dh=abs(R33−R31)+abs(R33−R35)+abs(G32−G34) and dv=abs(R33−R13)+abs(R33−R53)+abs(G23−G43), wherein the abs(R33−R31) is an absolute value of the difference between R33 and R31. Because the prior art design deduces the horizontal difference dh and the vertical difference dv by the color difference magnitude of the same color, the prior art design fails to identify certain specific color distributions of the color filter array 10. For example, when R13=G23=R33=G43=R53=G34 and R33=R31=R35, G32=G34, R31≠G32 (e.g. a pattern with a plurality of vertical stripes separated by one pixel), the horizontal difference dh and the vertical difference dv will all be zero. Thus, the prior art design averages the G23, G34, G43, G32 disposed around the pixel 33 to generate the green color value G33 of the pixel 33, and the computed green color value G33 will deviate from the real value. The proper method is to interpolate the G23 and G43 positioned in the vertical direction to generate the green color value G33 of the pixel 33. Therefore, how to effectively determine the surrounding color distribution of a pixel of a color filter array has become an urgent problem in the field of industry.